//
//  detialSectionHeadView.m
//  jiaKaoZhuShou
//
//  Created by 金艺社 on 2018/5/17.
//  Copyright © 2018年 金艺社. All rights reserved.
//

#import "detialSectionHeadView.h"

@implementation detialSectionHeadView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        
        UIView *topGreaView = [UIView new];
        topGreaView.backgroundColor = [UIColor groupTableViewBackgroundColor];
        [self addSubview:topGreaView];
        [topGreaView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(@0);
            make.left.equalTo(@0);
            make.right.equalTo(@0);
            make.height.equalTo(@10);
        }];
        
        UIView *leftRedView = [UIView new];
        leftRedView.backgroundColor = [UIColor redColor];
        [self addSubview:leftRedView];
        [leftRedView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.mas_top).offset(17);
            make.left.equalTo(@13);
            make.bottom.equalTo(@-7);
            make.width.equalTo(@3);
        }];
        
        _titleLab = [UILabel new];
        _titleLab.font = [UIFont customFontOfSize:15];
        [self addSubview:_titleLab];
        [_titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.mas_top).offset(12);
            make.left.equalTo(@20);
            make.bottom.equalTo(@-2);
            make.width.equalTo(@100);
        }];
    }
    
    return self;
}

- (void)setTitle:(NSString *)title {
    _title = title;
    _titleLab.text = _title;
}
@end
